package com.firebird.app.fekpsl.adapter.sword.community

import android.content.Context
import android.widget.ImageView
import com.firebird.app.fekpsl.R
import com.firebird.app.fekpsl.bean.Room

class RoomListAdapter(context: Context, layoutid:Int, data:MutableList<Room>?, var listener:RoomItemClickListener?):CurrencyAdapter<Room>(context,layoutid,data){

    override fun convert(holder: AdapterHolder, item: Room, position: Int) {
        holder.setTextViewText(R.id.tv_room_name,item.roomName)
        var image=holder.getImageView(R.id.iv_room_chiosed)
        var relat=holder.getRelativeLayout(R.id.relat_item)
        relat!!.setOnClickListener {
            listener!!.OnItemClickListener(item,image!!,position)
        }
    }

    interface RoomItemClickListener{
        fun OnItemClickListener(room:Room, image: ImageView, position: Int)
    }
}